Ext.define('UM.controller.ThemesController',
{
    extend : 'Ext.app.Controller',

    views :
    [
        'SelectThemePanel'
    ],

    refs :
    [
        {
            selector : '#mainContainerId selectThemesPanel',
            ref : 'themesPanel'
        }
    ],

    init : function()
    {
        var me = this;
        this.control(
        {
            '#mainContainerId' :
            {
                'themesLoaded' : function(themes)
                {
                    debugger
                    var panel = me.getThemesPanel();
                    panel.setEditObj(themes);
                }
            },
            '#mainContainerId selectThemesPanel #themesComboId' :
            {
                'select' : function(thiz, records)
                {
                    debugger
                    var theme = records[0].get('name');
                    Ext.util.CSS.swapStyleSheet('extTheme', "extjs/themes/" + theme + "/" + theme + ".css")
                }
            }
        });
        this.application.on({});
    }
});